package com.abel.eurekaclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author: Abel.lin
 * Date: Created in 2018/10/9 16:40
 * Company: Abel.Studio
 * Copyright: Copyright (c) 2017
 * Description:
 */
@RestController
@RefreshScope
public class IndexController {
    @Value("${server.port}")
    String port;
    @Value("${abel.name}")
    String sysTitle;


    @GetMapping("hello")
    public String hello(){
        return String.format("hello, %s. %s", sysTitle, port);
    }

    @GetMapping("bye")
    public String bye(@RequestParam(value = "name")String name){
        return String.format("bye! %s. port:%s", name, port);
    }

    @GetMapping("test2")
    public String test(){
        return String.format("test. port:%s", port);
    }
}
